import 'dart:async';

class MessageService {
  static final MessageService _instance = MessageService._internal();
  factory MessageService() => _instance;
  MessageService._internal();

  final _messageController = StreamController<String>.broadcast();

  Stream<String> get messageStream => _messageController.stream;

  void showError(String message) {
    _messageController.add(message);
  }

  void dispose() {
    _messageController.close();
  }
}